package evaluation.pattern;

public class PatternElement {
	private String pattern;
	private int correctNum=0;
	private int wrongNum=0;
	private int length=Integer.MAX_VALUE;
	public PatternElement(String pattern)
	{
		this.pattern = pattern;
		String[] parts = this.pattern.split("\\s+|#");
		this.length = parts.length;
		if(pattern.startsWith("VP#")) this.length+=100;
		if(pattern.startsWith("NP#")) this.length+=1000;
		if(pattern.startsWith("NX#")) this.length+=10000;
	}
	public void addCorrectNum()
	{
		this.correctNum++;
	}
	public void addWrongNum()
	{
		this.wrongNum++;
	}
	public String toString()
	{
		return this.pattern+" correct num:"+this.correctNum+"  wrong num:"+this.wrongNum;
	}
	public String getPattern()
	{
		return this.pattern;
	}
	public boolean sholdDelete()
	{
		if(this.wrongNum>30) return true;
		if(this.correctNum==0) return true;
		//else return false;
		//if(this.correctNum*3>=this.wrongNum||this.correctNum>=2) return false;
		//if(this.correctNum==0&&this.wrongNum!=0) return true;
		//if(this.correctNum==0) return true;
		//if(this.wrongNum<3) return false;
		return false;
	}
	public int getLength()
	{
		return this.length;
	}
	
}
